home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
libelfutil
/
xlate_pro_init.z
/
xlate_pro_init
Wrap
Text File
|
1998-10-30
|
18KB
|
330 lines
XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE)))) XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE))))
NNNNAAAAMMMMEEEE
_xxxx_llll_aaaa_tttt_eeee______pppp_rrrr_oooo______iiii_nnnn_iiii_tttt - open translation section creator
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_eeee_llll_ffff_...._hhhh_>>>>
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_eeee_llll_ffff_...._hhhh_>>>>
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_dddd_wwww_aaaa_rrrr_ffff_...._hhhh_>>>>
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_dddd_wwww_aaaa_rrrr_ffff_...._hhhh_>>>>
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_cccc_mmmm_pppp_llll_rrrr_ssss_////_xxxx_llll_aaaa_tttt_eeee_...._hhhh_>>>>
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_XXXX_llll_aaaa_tttt_eeee_...._hhhh_>>>>
_iiii_nnnn_tttt _xxxx_llll_aaaa_tttt_eeee______pppp_rrrr_oooo______iiii_nnnn_iiii_tttt_(((( _xxxx_llll_aaaa_tttt_eeee______tttt_aaaa_bbbb_llll_eeee______pppp_rrrr_oooo _****_rrrr_eeee_tttt_uuuu_rrrr_nnnn_eeee_dddd______tttt_aaaa_bbbb_llll_eeee______pppp_oooo_iiii_nnnn_tttt_eeee_rrrr_,,,,
_xxxx_llll_aaaa_tttt_eeee______tttt_aaaa_bbbb_llll_eeee_kkkk_iiii_nnnn_dddd _tttt_aaaa_bbbb_llll_eeee_kkkk_iiii_nnnn_dddd_,,,,
_xxxx_llll_aaaa_tttt_eeee______tttt_aaaa_bbbb_llll_eeee______cccc_oooo_nnnn _cccc_oooo_mmmm_pppp_oooo_ssss_eeee______wwww_iiii_tttt_hhhh______tttt_aaaa_bbbb_llll_eeee_,,,,
_iiii_nnnn_tttt _iiii_ssss_6666_4444_bbbb_iiii_tttt_))))_;;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
These are used to get (open) a handle which assists in producing a
translation table section. The functions available do not themselves
write anything to disk. Instead they create a byte stream which the
calling application can write to an Elf file as appropriate.
The handle allows one to call any of the producer functions.
_x_l_a_t_e__p_r_o__i_n_i_t takes as arguments:
_r_e_t_u_r_n_e_d__t_a_b_l_e__p_o_i_n_t_e_r
is a pointer to a producer table handle. If the call to
_x_l_a_t_e__p_r_o__i_n_i_t is successful, the handle pointed to is set a
valid producer library handle.
_t_a_b_l_e_k_i_n_d
which must be one of the types of table defined in the
enumeration: order-preserving, size-preserving, or general. See
<_l_i_b_X_l_a_t_e._h>. The order-preserving and size-preserving cases
allow a slightly more compact disk representation to be used.
See below for more discussion of the table choices.
_c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e
must be 0 or a valid open handle on a (non-debug) translate table
section. If 0 (the NULL pointer) then the byte stream prepared
by the library will depend solely on the input from producer
calls. A 0 argument means that there will be a single byte
stream available in the output. If an open consumer handle is
passed in then the library will _c_o_m_p_o_s_e the information passed in
thru producer calls with the information from _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e
and will make available two byte stream outputs: one will be the
composed translation table representing all translations and the
second (debug) table will represent solely the information passed
in thru producer calls. _x_l_a_t_e__p_r_o__d_i_s_k__h_e_a_d_e_r(3) gives access to
the normal (standard) byte stream if called with
_X_L_A_T_E__P_R_O__S_T_A_N_D_A_R_D__S_E_T_U_P. _x_l_a_t_e__p_r_o__d_i_s_k__h_e_a_d_e_r(3) gives access
to the debug stream if called with _X_L_A_T_E__P_R_O__S_T_A_N_D_A_R_D__S_E_T_U_P: the
PPPPaaaaggggeeee 1111
XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE)))) XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE))))
debug stream will only have non-zero length if _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e
is a non-NULL consumer table handle.
_i_s_6_4_b_i_t informs the producer library whether the translate table is for a
64 or 32 bit executable or DSO. Pass in 0 if for a 32-bit
executable or DSO. Pass in 1 if for a 64-bit executable or DSO.
The flag must match (in the sense of being 32 or 64 bit) the 64-
bitness of the data in the _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e .
Use -lelfutil -lelf on the link command line to link in _l_i_b_e_l_f_u_t_i_l.
TTTTaaaabbbblllleeee KKKKiiiinnnnddddssss
The table kind argument specifies characteristics of the addresses and
ranges passed in to the producer functions. If there is no Table
Composition (because _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e us NULL) then the _t_a_b_l_e_k_i_n_d
argument is the output non-debug table kind (and there is no debug table
produced). If there is Table Composition because _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e is
non-NULL then the table kind of the created table may not be identical to
that specified in the argument.
It is the producing application's responsibility to tell the truth about
the input. If the application specifies that the input is order-
preserving and then does _x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e calls which violate that
assertion the library may or may not detect the violation. The resulting
table is not going to be correct in such a case.
An order-preserving table (_x_l_a_t_e__t_k__p_r_e_s_e_r_v_e__s_i_z_e) is created by calls to
_x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e in which successive new-addresses are increasing and
successive old-addresses are increasing.
A size-preserving table (_x_l_a_t_e__t_k__p_r_e_s_e_r_v_e__s_i_z_e) is created by calls to
_x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e in which the new-range and the old-range are
identical values (in other words, the new and old instruction streams are
identical length). The library assumes that the new-instruction
addresses form a strictly increasing sequence (the old-instruction
addresses ordinarily do not).
A general table is any table not fitting one of the two special cases
above. The library assumes that the new-instruction addresses form a
strictly increasing sequence (so that while the library can handle
"general" transformations, the order that the transformations are
presented to _x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e is restricted to be in increasing new-
address order).
TTTTaaaabbbblllleeee CCCCoooommmmppppoooossssiiiittttiiiioooonnnn
Table Composition allows the application of a (potentially unlimited)
series of transformation tools while preserving the ability to use a
debugger or other tool needing to correctly associate text address in
memory with the symbolic information and with the original untransformed
text addresses. If _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e is NULL then there is no Table
Composition done (there being no input table provided to compose with).
PPPPaaaaggggeeee 2222
XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE)))) XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE))))
If _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e is non-NULL then table composition will occur.
Composing a size-preserving with a size-preserving table results in a
size-preserving table. Composing an order-preserving with an order-
preserving table results in a order-preserving table. Any other
composition results in a general table.
The application doing the transformation should treat its composition as
the only composition and should treat the executable text as being
transformed. The library does the composition.
Composition of addresses is done by the library. The following describes
how each of the fields in the each of the translate headers is treated.
_h_d__v_e_r_s_i_o_n
will be the same in both the debug and non-debug tables output.
_h_d__t_a_b_l_e_k_i_n_d
will be taken directly from the _t_a_b_l_e_k_i_n_d argument for the debug
table. For the non-debug table the value will be as described in
_T_a_b_l_e _K_i_n_d_s above.
_h_d__b_l_o_c_k__s_i_z_e
For both the debug and non-debug tables the library supplies
this. (At this writing it is a fixed value of 4096).
_h_d__n_u_m__b_l_o_c_k_s
is set appropriately by the library for each table output.
_h_d__n_u_m__e_n_t_r_i_e_s
is set appropriately by the library for each table output.
_h_d__n_e_w__a_d_d_r__l_o_w
For both the tables this is the same value: the lowest of the new
addresses.
_h_d__n_e_w__a_d_d_r__h_i_g_h
For both the tables this is the same value: the highest of the
new addresses.
_h_d__o_l_d__a_d_d_r__l_o_w
For the non-debug table, this is the copied from the
_h_d__o_l_d__a_d_d_r__l_o_w of the input table-to-be-composed-with. For the
debug table, this is calculated from the ranges seen by
_x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e.
_h_d__o_l_d__a_d_d_r__h_i_g_h
For the non-debug table, this is the copied from the
_h_d__o_l_d__a_d_d_r__h_i_g_h of the input table-to-be-composed-with. For the
debug table, this is calculated from the ranges seen by
_x_l_a_t_e__p_r_o__a_d_d__r_a_n_g_e.
PPPPaaaaggggeeee 3333
XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE)))) XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE))))
_h_d__d_a_t_a__m_o_v_e_d
For the debug table, this is taken from the _x_l_a_t_e__p_r_o__a_d_d__i_n_f_o
call (defaults to 0). For the non-debug table, the output value
is the sum (using 32 bit arithmetic for 32 bit programs and 64
bit arithmetic for 64 bit programs) of the from the input table-
to-be-composed-with and the _d_a_t_a__m_o_v_e_d argument of the
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o call.
_h_d__s_t_a_r_t_u_p__f_w_a
For the debug table, this is taken from the appropriate
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o call argument (defaults to 0). For the non-
debug table, take that argument if non-zero and if the
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o is not provided or the argument is 0 take the
value from the _h_d__s_t_a_r_t_u_p__f_w_a from the input table-to-be-
composed-with.
_h_d__s_t_a_r_t_u_p__l_w_a
For the debug table, this is taken from the appropriate
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o call argument (defaults to 0). For the non-
debug table, take that argument if non-zero and if the
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o is not provided or the argument is 0 take the
value from the _h_d__s_t_a_r_t_u_p__l_w_a from the input table-to-be-
composed-with.
_h_d__o_l_d__t_e_x_t__e_x_i_s_t_s
For the non-debug table, take the value from the input table-to-
be-composed with. For the debug table, take the value from the
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o call argument (defaults to 0).
_h_d__o_l_d__t_e_x_t__a_l_l_o_c
For the non-debug table, take the value from the input table-to-
be-composed with. For the debug table, take the value from the
_x_l_a_t_e__p_r_o__a_d_d__i_n_f_o call argument (defaults to 0).
_h_d__r_e_g__i_n_f_o__s_i_z_e
For the debug table, take the data provided with
_x_l_a_t_e__p_r_o__a_d_d__r_e_g__i_n_f_o calls. For the non-debug table, add the
data provided with _x_l_a_t_e__p_r_o__a_d_d__r_e_g__i_n_f_o calls to the end of the
data in the input table-to-be-composed-with. This behavior is
incorrect, since any DW_CFA_set_loc or DW_CFA_advance_loc
operations in the table-to-be-composed-with are not updated
appropriately as of this writing.
FFFFIIIILLLLEEEESSSS
/usr/include/libXlate.h
/usr/include/cmplrs/xlate.h
/usr/include/elf.h
/usr/include/dwarf.h
/usr/include/libdwarf.h
/usr/lib/libelfutil.a
PPPPaaaaggggeeee 4444
XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE)))) XXXXLLLLAAAATTTTEEEE____PPPPRRRROOOO____IIIINNNNIIIITTTT((((3333EEEE))))
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
Returns XLATE_TB_STATUS_NO_ERROR (0) on success. In case of error, a
negative number is returned indicating the error. In case of error,
nothing is returned thru the pointer arguments which would return values
on successful call (values might have been changed thru these pointers
but any such changes are not meaningful).
_X_L_A_T_E__T_B__S_T_A_T_U_S__B_A_D__T_A_B_L_E_K_I_N_D
means that the passed in _t_a_b_l_e_k_i_n_d is not one of the three
defined values.
_X_L_A_T_E__T_B__S_T_A_T_U_S__A_L_L_O_C__F_A_I_L
means _m_a_l_l_o_c() failed.
_X_L_A_T_E__T_B__S_T_A_T_U_S__P_R_O__C_O_N__T_A_B_L_E__M_I_S_M_A_T_C_H
The _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e and the table being created are not both
64bit or both 32 bit. Instead one is marked as a 32 bit
translation table and the other is 64 bit.
In addition, if the _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e is non-null then any error which
might be returned by _x_l_a_t_e__g_e_t__i_n_f_o() on the _c_o_m_p_o_s_e__w_i_t_h__t_a_b_l_e may be
returned.
CCCCAAAAVVVVEEEEAAAATTTTSSSS
Any register information in a table-to-be-composed-with that contains a
DW_CFA_set_loc or DW_CFA_advance_loc operation is not updated or
corrected by the library at present: this is a bug.
If an xlate section is created in an Elf file, it is required to have at
least one range record. An xlate section without at least one range is
illegal (and the effect is undefined).
SSSSEEEEEEEE AAAALLLLSSSSOOOO
libelfutil(5), xlate(4), xlate_pro_add_info(3e),
xlate_pro_add_reg_info(3e), xlate_pro_add_range(3e),
xlate_pro_disk_header(3e), xlate_pro_disk_next_block(3e),
xlate_init_fd(3e), xlate_pro_finish(3e)
PPPPaaaaggggeeee 5555